package com.ruoyi.office.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.office.mapper.LeaveMapper;
import com.ruoyi.office.domain.Leave;
import com.ruoyi.office.service.ILeaveService;

/**
 * 请假Service业务层处理
 * 
 * @author ldl
 * @date 2023-05-23
 */
@Service
public class LeaveServiceImpl implements ILeaveService 
{
    @Autowired
    private LeaveMapper leaveMapper;

    /**
     * 查询请假
     * 
     * @param id 请假主键
     * @return 请假
     */
    @Override
    public Leave selectLeaveById(Long id)
    {
        return leaveMapper.selectLeaveById(id);
    }

    /**
     * 查询请假列表
     * 
     * @param leave 请假
     * @return 请假
     */
    @Override
    public List<Leave> selectLeaveList(Leave leave)
    {
        return leaveMapper.selectLeaveList(leave);
    }

    /**
     * 新增请假
     * 
     * @param leave 请假
     * @return 结果
     */
    @Override
    public int insertLeave(Leave leave)
    {
        return leaveMapper.insertLeave(leave);
    }

    /**
     * 修改请假
     * 
     * @param leave 请假
     * @return 结果
     */
    @Override
    public int updateLeave(Leave leave)
    {
        return leaveMapper.updateLeave(leave);
    }

    /**
     * 批量删除请假
     * 
     * @param ids 需要删除的请假主键
     * @return 结果
     */
    @Override
    public int deleteLeaveByIds(Long[] ids)
    {
        return leaveMapper.deleteLeaveByIds(ids);
    }

    /**
     * 删除请假信息
     * 
     * @param id 请假主键
     * @return 结果
     */
    @Override
    public int deleteLeaveById(Long id)
    {
        return leaveMapper.deleteLeaveById(id);
    }
}
